﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace NutriLeaf.Phone.Core.Height
{
    public class Converter
    {
        public static decimal Convert(decimal value, HeightUnits from, HeightUnits to)
        {
            if (from == to)
            {
                return value;
            }

            if (from == HeightUnits.Centimeters && to == HeightUnits.Inches)
            {
                return (decimal)(value * (decimal)0.3937);
            }

            if (from == HeightUnits.Inches && to == HeightUnits.Centimeters)
            {
                return (decimal)(value * (decimal)2.54);
            }
            return 0;
        }
    }
}
